import request from '@/utils/request'

export default {

  /**
   * 分页获取学生列表
   * @param studentPageParams  查询学生信息所需数据对象
   */
  getStudents(studentPageParams) {
    return request({
      url: '/student/getStudentByPage',
      method: 'get',
      params: studentPageParams
    })
  },

  /**
   * 删除学生
   * @param id 学生id
   */
  delStudentById(id){
    return request({
      url:`/student/delStudentById/${id}`,
      method: 'delete'
    })
  },

  /**
   * 添加学生
   * @param studentInfo 学生信息
   */
  addStudent(studentInfo){
    return request({
      url:'/student/addStudent',
      method:'post',
      data: JSON.stringify(studentInfo)
    })
  },

  updStudent(studentInfo){
    return request({
      url:'/student/updStudent',
      method:'put',
      data: JSON.stringify(studentInfo)
    })
  },

  getStudentByGender(gender){
    return request({
      url:`/student/getStudentsByGender/${gender}`,
      method:'get'
    })
  }
}
